<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>添加比赛</title>
    <th:block th:include="fragments/header :: header"/>
</head>
<body class="easyui-layout">
<div data-options="region:'center',border:false">
    <form id="matchForm" action="" method="post" style="padding-top: 10px;padding-left: 20px;">
        <table width="90%">
            <tr>
                <td>赛季:</td>
                <td>
                    <input class="easyui-combobox" id="season" name="season" style="width: 90%" data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td>比赛日:</td>
                <td>
                    <input class="easyui-numberbox" name="matchday" style="width: 90%" data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td>时间:</td>
                <td>
                    <input class="easyui-datebox" name="time" style="width: 90%" data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td>主队:</td>
                <td>
                    <select class="easyui-combobox" id="homeTeam" name="homeTeam" style="width: 100px;" data-options="animate:true,required:true">
                    </select>
                </td>
            </tr>
            <tr>
                <td>主队进球数:</td>
                <td>
                    <input class="easyui-numberbox" name="homeGoal" style="width: 90%" data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td>客队:</td>
                <td>
                    <select class="easyui-combobox" id="awayTeam" name="awayTeam" style="width: 100px;" data-options="animate:true,required:true">
                    </select>
                </td>
            </tr>
            <tr>
                <td>客队进球数:</td>
                <td>
                    <input class="easyui-numberbox" name="awayGoal" style="width: 90%" data-options="required:true"/>
                </td>
            </tr>

        </table>
    </form>
</div>
<script>
    function submitForm() {
        $("#matchForm").form('submit',{
            url:'/markt/match/save',
            onSubmit:function () {
                return $(this).form('enableValidation').form('validate');
            }
        });
    }

    $(function () {
        // $("#season").combobox({
        //     url: "/markt/enumManage/getEnumTree/?enumName=赛季",
        //     valueField:'id',
        //     textField:'text'
        // })
        // initComboboxValue("season","赛季");
        ComboboxUtil.Init("season","/markt/enumManage/getEnumTree/?enumName=赛季");
        ComboboxUtil.Init("homeTeam","/markt/club/getClubTree");
        ComboboxUtil.Init("awayTeam","/markt/club/getClubTree");
    })
</script>
</body>
</html>
